package com.itheima.mapper;


import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface UserAdminMapper {
    List<User> findPage(@Param("queryString") String queryString);

    void add(User user);

    void edit(User user);

    void deleteUserAdminById(@Param("id") Integer id);

    @Select("select role_id from t_user_role where user_id=#{id}")
    List<Integer> finUserAndRoleById(@Param("id") Integer id);

    @Select("select name from t_role where id=#{roleId}")
    String findRoleName(@Param("roleId") Integer roleId);

    void addUserAndRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

    void removeUserAndRoleByUserId(@Param("userId") Integer userId);


}
